<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="zh" xmlns:th="http://www.thymeleaf.org" style="height: 100%">
<body class="body_hei edit">
<style>
    .layui-form-item{border: none !important;background: none !important;}
</style>
<div th:replace="include/head.html::html"></div>
<form class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin"
     style="padding: 20px 0 0 0;background-color: #FFFFFF;height: 100%">
    <!--<div class="layui-form-item">
        <label class="layui-form-label">请选择部门</label>
        <div class="layui-input-inline" id="sele">
            <input type="text" name="deptName" id="deptName" lay-verify="required" placeholder="请选择" autocomplete="off"
                   class="layui-input" th:value="${sysDept?.deptName}" readonly >
            <input type="hidden" name="deptOid" id="deptOid" lay-verify="required" th:field="${bean.deptOid}">
        </div>
    </div>-->
    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-inline">
            <select name="roleOid" lay-verify="required" lay-search="">
                <option value="">请选择角色</option>
                <option th:each="item:${sysRoleList}" th:if="${item.oid != '00000000000000000000000000000000'}" th:value="${item.oid}" th:selected="${item.oid == sysUserRole?.roleOid}" th:text="${item.roleName}"></option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <input type="text" name="name" lay-verify="required" placeholder="请输入" autocomplete="off"
                   class="layui-input" th:field="${bean.name}" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline">
            <select name="sex" lay-verify="required" lay-search="">
                <option value="">请选择性别</option>
                <option value="1" th:selected="${bean.sex == 1}">男</option>
                <option value="2" th:selected="${bean.sex == 2}">女</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">登录账号</label>
        <div class="layui-input-inline">
            <input type="text" name="account" lay-verify="required" placeholder="请输入" autocomplete="off"
                   class="layui-input" th:field="${bean.account}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-inline">
            <input type="text" name="phone" placeholder="请输入" autocomplete="off"
                   class="layui-input" th:field="${bean.phone}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="email" placeholder="请输入" autocomplete="off"
                   class="layui-input" th:field="${bean.email}">
        </div>
    </div>
    <input type="hidden" name="oid" th:field="${bean.oid}"/>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="submit" id="submit" value="确认">
    </div>
</form>
<script type="text/javascript" th:inline="javascript">
    layui.use(['jquery','layer', 'form', 'upload', 'layedit'], function () {
        var $ = layui.$
            , form = layui.form
            , upload = layui.upload;
        var layedit = layui.layedit;
        var layer = layui.layer;
        $("#sele").on('click',function () {
            selectList();
        });
        function selectList() {
            openLayer({
                title:'选择部门',
                url:'sysDept/selectList?deptOid='+[[${bean.deptOid}]],
                area:['30%','80%'],
                back:function (ifr,index,data) {
                    $("#deptName").val(data.field.deptName);
                    $("#deptOid").val(data.field.oid);
                    topLayer.close(index);
                }
            });
        }
    });
</script>
</body>
</html>